package dbsucxentW.pathProcessorW;

import dbsucxentW.xpathW.Node;
import dbsucxentW.xpathW.SimpleNode;

public class PredicateNodes {

	protected SimpleNode _PredicateList;
	protected SimpleNode _currPredicateExpr;
	
	protected int _counter;
	protected int _noOfPredicates = 0;
	
	public PredicateNodes(SimpleNode node) {
		_PredicateList = node;
		_counter = -1;
        _noOfPredicates = _PredicateList.jjtGetNumChildren();
	}
	
	public PredicateNodes(Node node) {
		_PredicateList = (SimpleNode) node;
		_counter = -1;
        _noOfPredicates = _PredicateList.jjtGetNumChildren();
	}
	
	public SimpleNode nextPredicateExpr(){
		_counter++;
		_currPredicateExpr = (SimpleNode) _PredicateList.jjtGetChild(_counter).jjtGetChild(0); 
		return _currPredicateExpr; 
	}

	public void dump(String prefix) {
		_PredicateList.dump(prefix);
    }

	public String dumpString(String prefix) {
    	String dump = _PredicateList.dumpString(prefix);
        return dump;
    }
    
}
